<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Dashboard.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="ComLib.Diagnostics" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Diagnostics</h2>
    <div>
    
    <% IDictionary diagnosticSections = this.Model as IDictionary;
        
       // Each DiagnosticGroup : MachineInfo, EnvUser, Modules, etc. from ComLib.Diagnostics        
       foreach (DictionaryEntry entry in diagnosticSections)
       {
           var section = entry.Key.ToString();
           IDictionary sectionData = diagnosticSections[section] as IDictionary;
    %>
    <br /><br /><div><% Response.Write(section); %></div>
    <table class="systemlist">
    <%
        foreach (DictionaryEntry dataEntry in sectionData)
        {
            // Key : Value
            // OS Version Platform : Win32NT
            string key = dataEntry.Key.ToString();
            object val = dataEntry.Value;
            string displayVal = val.ToString();
            
            if (val is LoadedModule)
            {
                LoadedModule mod = val as LoadedModule;
                displayVal = string.Format(@"{0}<br/>{1}", mod.FullPath, mod.Version);
                key = mod.Name;
            }
            %>            
            <tr><td><%= displayVal %></td></tr>
            <%
        }
       }
    %>
    </table>    
    </div>
</asp:Content>
